<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<%
	xMode = Request("xMode")
	paramLotNo = Request("fullLotNo")
	paramPrdNm = Request("prdNm")

	'## ■■ 공정그룹 가져오기 ■■■■
	yrSQL = "SELECT lotYear FROM tblOrder GROUP BY lotYear ORDER BY lotYear DESC" 

	Set yrRs=Server.CreateObject("ADODB.RecordSet")
	yrRs.open yrSQL, DbCon, 1
	
	If yrRs.eof Or yrRs.bof Then 
	Else 
		Do Until yrRs.eof Or yrRs.bof
		
		yrOptions = yrOptions & "<option value=""" & yrRs("lotYear") & """>20" & yrRs("lotYear") & "</option>" & vbcrlf

		yrRs.movenext
		Loop 
	End If
	
	'## ■■ 공정그룹 가져오기 ■■■■
	procSetSQL = "SELECT procTypeCd, procTypeNm FROM tblProcSet WHERE flag='Y' ORDER BY procTypeNm" 
	procSet = mkSQLCombo(procSetSQL)
	
	'## ■■ User 정보 가져오기 ■■■■
	userSQL = "SELECT userId, userNm FROM tblUser WHERE delYN='N' AND uLevel<>'05' ORDER BY userNm"
	userAll = mkSQLCombo(userSql)

	'## ■■ 장비 정보 가져오기 ■■■■
	equips = mkComCombo("0001")	   	'## 장비 콤보

	'## ■■ 제품 정보 가져오기 ■■■■	
	prdSQL = "SELECT prdCd, prdNm, etcPrdCd, flag FROM tblProduct WHERE flag<>'N' ORDER BY etcPrdCd DESC, prdNm" 

	Set prdRs=Server.CreateObject("ADODB.RecordSet")
	prdRs.open prdSQL, DbCon, 1
	
	If prdRs.eof Or prdRs.bof Then 
	Else 
		Do Until prdRs.eof Or prdRs.bof
		
			etcPrdCd = ""
			If prdRs("etcPrdCd") <> "" Then 
				etcPrdCd = "[" & prdRs("etcPrdCd") & "] "
			End If 
			style = ""
			If prdRs("flag") = "H" Then 
				style = " style=""color:#999"""
			End If 
			prdOption = prdOption & "<option value=""" & prdRs("prdCd") & """" & style & ">" & etcPrdCd & prdRs("prdNm") & "</option>" & vbCrlf

		prdRs.movenext
		Loop 
	End If

	'## ■■ 원자재 정보 가져오기 ■■■■	
	orgSrcSQL = "SELECT srcCd, srcNm FROM tblSrc WHERE  flag='Y' AND type='S' ORDER BY srcSeq" 
	orgSrcOption = mkSQLCombo(orgSrcSQL)

	'## ■■ 불량율 가져오기 ■■■■
	'## 전월 구하기
	bfMonth = dateadd("m",-1,Date())
	bfMnthBadRate = getBadRate(bfMonth)	
	bfMonthBadRateTxt = bfMnthBadRate
	'## 이번달 구하기
	curMonth = Left(Date(),7)
	curMnthBadRate = getBadRate(curMonth)
	curMonthBadRateTxt = "<span style='font-size:15px;font-weight:bold;color:#FF0000'>" & curMnthBadRate & "</span>"

	curWeekDay = weekday(Date())-2
	If curWeekDay < 0 Then curWeekDay = 7 + curWeekDay End If 	

	'## 전주 구하기
	bfWeekStart = dateadd("d",-(7+curWeekDay),Date())
	bfWeekEnd = dateadd("d",-(curWeekDay),Date())	
	bfWeekRate10 = aFieldValue("SELECT  (CAST(SUM(isnull(goodQty,0)) as varchar(10))+'/'+CAST(SUM(isnull(badQty,0)) as varchar(10))) FROM tblOrderResult A INNER JOIN tblOrder B ON A.lotNo=B.lotNo AND A.lotSubNo=B.lotSubNo AND A.lotYear=B.lotYear WHERE A.type='10' AND A.flag='Y' AND B.flag<>'N' AND B.type='L' AND A.workDt >= '" & bfWeekStart & "' AND A.workDt < '" & bfWeekEnd & "'")
	bfWeekRate20 = aFieldValue("SELECT SUM(isnull(badQty,0)) FROM tblOrderResult A INNER JOIN tblOrder B ON A.lotNo=B.lotNo AND A.lotSubNo=B.lotSubNo AND A.lotYear=B.lotYear WHERE A.type='20' AND A.flag='Y' AND B.flag<>'N' AND B.type='L' AND A.workDt >= '" & bfWeekStart & "' AND A.workDt < '" & bfWeekEnd & "'")
	If bfWeekRate10 <> "" Then
		divBfWeekRate = Split(bfWeekRate10,"/")
		If (CDbl(divBfWeekRate(0))+CDbl(divBfWeekRate(1))) > 0 Then 
			bfWeekBadRate = (CDbl(divBfWeekRate(1))+CDbl(bfWeekRate20))/(CDbl(divBfWeekRate(0))+CDbl(divBfWeekRate(1))) * 100
			bfWkBadRate = mkRateFormat(Round(bfWeekBadRate,3))
		Else
			bfWkBadRate= 0 
		End if
	Else
		bfWkBadRate= 0 
	End If
	bfWeekBadRateTxt = "이전주 : " & bfWkBadRate & "%"
	
	'##금주 구하기
	curWeekStart = dateadd("d",-(curWeekDay),Date())
	curWeekEnd = dateadd("d",7,curWeekStart)	
	curWeekRate10 = aFieldValue("SELECT  (CAST(SUM(isnull(goodQty,0)) as varchar(10))+'/'+CAST(SUM(isnull(badQty,0)) as varchar(10))) FROM tblOrderResult A INNER JOIN tblOrder B ON A.lotNo=B.lotNo AND A.lotSubNo=B.lotSubNo AND A.lotYear=B.lotYear WHERE A.type='10' AND A.flag='Y' AND B.flag<>'N' AND B.type='L' AND A.workDt >= '" & curWeekStart & "' AND A.workDt < '" & curWeekEnd & "'")
	curWeekRate20 = aFieldValue("SELECT  (CAST(isnull(SUM(badQty),0) as varchar(10))) FROM tblOrderResult A INNER JOIN tblOrder B ON A.lotNo=B.lotNo AND A.lotSubNo=B.lotSubNo AND A.lotYear=B.lotYear WHERE A.type='20' AND A.flag='Y' AND B.flag<>'N' AND B.type='L' AND workDt >= '" & curWeekStart & "' AND workDt < '" & curWeekEnd & "'")
	If curWeekRate10 <> "" Then 
		divCurWeekRate = Split(curWeekRate10,"/")
		If (CDbl(divCurWeekRate(0))+CDbl(divCurWeekRate(1))) > 0 Then 
			curWeekBadRate = (CDbl(divCurWeekRate(1))+CDbl(curWeekRate20))/(CDbl(divCurWeekRate(0))+CDbl(divCurWeekRate(1))) * 100
			curWkBadRate = mkRateFormat(Round(curWeekBadRate,3))
		Else 
			curWkBadRate= 0 
		End If 
	Else
		curWkBadRate = 0
	End If 
	curWeekBadRateTxt = "금주 : <span style='font-size:15px;font-weight:bold;color:#FF0000'>" & curWkBadRate & "%</span>"
%>
<!-- #include virtual=/inc/header_cross.inc.asp -->  

<script language="javascript">
	var G_userAll = '<%=userAll%>'; //유저 콤보 전역변수로 받기
	var G_equip = '<%=equips%>';	//장비 콤보 전역변수로 받기
	
    $(window).load(function(){
		setMainMenu();
		fnCommonInit();
		$("#layer01").css("display","");
		$("#layer02").css("display","none");
		intervalNotice();
<%	If paramPrdNm <> "" then	
			Response.write "grid01List();"
		End If 
		If paramLotNo <> "" then 
			divLotNo = split(paramLotNo,"-")
			lotNo = divLotNo(0)
			
			If isnull(divLotNo(1)) = true then 
				subLotNo = 0
			Else 
				subLotNo = divLotNo(1)
			End If
			Response.write "fnSetJobOrder('" & lotNo & "','" & subLotNo & "');" & vbcrlf
		End If
%>
    }); 
    
		 $(document).ready(function() {
			  var clareCalendar = {
			   monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			   dayNamesMin: ['일','월','화','수','목','금','토'],
			   weekHeader: 'Wk',
			   dateFormat: 'yy-mm-dd',														// 날짜형식(2012-03-03)
			   autoSize: false,																	//자동리사이즈(false 이면 상위 정의에 따름)
			   changeMonth: true,															// true이면 월변경, false이면 월변경못함
			   changeYear: true,																// true이면 년변경, false이면 년변경못함
			   showMonthAfterYear: true,													//년 뒤에 월 표시
			   buttonImageOnly: true,														//이미지표시
			   //buttonText: '달력선택',														//버튼 텍스트 표시
			   //buttonImage: '/calendar.gif',												//이미지주소
			   //showOn: "both",																//엘리먼트와 이미지 동시 사용(both,button)
			   yearRange: 'c-99:c+99',													//1990년부터 2020년까지
			   maxDate: '+2Y',																	// 오늘부터6년후날짜까지만, '+0d' 오늘 이전 날짜만 선택
			   minDate: '-5y'
			  };
			  $("#deliveryDt").datepicker(clareCalendar);
			  $("#planDt").datepicker(clareCalendar);
			  $("#endDate").datepicker(clareCalendar);
			  $("#stDate").datepicker(clareCalendar);
			  $("img.ui-datepicker-trigger").attr("style","margin-left:5px; vertical-align:middle; cursor:pointer;"); //이미지버튼 style적용
			  $("#ui-datepicker-div").hide(); //자동으로 생성되는 div객체 숨김  
		});
</script>

<BODY topmargin="0" leftmargin="0">
<!-- #include virtual=/inc/menu.inc.asp -->  

<br>
<div style="text-align:left">
<table border="0" cellpadding="0" cellspacing="0" width="1110">
	<tr>
		<td width="210">
			<table border="0" cellpadding="0" cellspacing="0" width="250" style="margin-left:5px" id="orderSubMenu">
				<tr>
					<td width="24%" class="lTD_trbl" onclick="fnOrderShow('0')" style="height:26px;text-align:center;font-weight:bold; background-color:#eaf2fd;CURSOR:hand;BORDER-TOP: #ff3300 5px solid;">지 시</td>
					<td width="24%" class="lTD_trb0" onclick="fnOrderShow('1')" style="height:26px;text-align:center;background-color:#eaf2fd;CURSOR:hand;BORDER-TOP: #ff3300 5px solid;">상 세</td>
					<td width="24%" class="lTD_trb0" onclick="fnOrderShow('2')" style="height:26px;text-align:center;background-color:#eaf2fd;CURSOR:hand;BORDER-TOP: #ff3300 5px solid;">출 하</td>
					<td width="28%" class="lTD_trb0" onclick="mvPage('extraOrder')" style="height:26px;text-align:center;background-color:#eaf2fd;CURSOR:hand;">가공(2팀)</td>
				</tr>
			</table>
		</td>
		<td align="right">
			<table border="0" cellpadding="0" cellspacing="0" width="830">
				<tr>
					<td width="100%" class="lTD_trbl" style="height:26px;padding-left:10px;color:#6600ff; background-color:#eaf2fd;text-align:left" id="topNotice">&nbsp;</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="1000" style="margin-left:5px"><tr><td style="height:5px"></td></tr></table>
<table border="0" cellpadding="0" cellspacing="0" width="1110" style="margin-left:5px">
	<tr>
		<td width="100%" valign="top" style="height:20px;text-align:right;padding-right:10px">
			[<%=bfMonthBadRateTxt%> / <%=curMonthBadRateTxt%>] | [<a title="<%=bfWeekStart%>~<%=bfWeekEnd%>"><%=bfWeekBadRateTxt%></a> / <a title="<%=curWeekStart%>~<%=curWeekEnd%>"><%=curWeekBadRateTxt%></a>]
		</td>
	</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="1235" style="margin-left:5px">
	<tr>
		<td width="100%" class="lTD_trbl" valign="top" style="padding: 5px 5px 5px 5px;">
			<!-- ■■ 첫번째 레이어 시작 ■■ -->
			<div id="layer01" style="display:">
			<!-- 검색 영역 시작 -->
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
					<tr height="40">
						<td style="padding: 0px 0 0px 10px;background-image:url(/inc/layout/panel-title-light-bg.gif);font-weight:bold;text-align:left" width="100%" class="lTD_trbl">
							<select name="findLotYear" id="findLotYear">
								<%=yrOptions%>
							</select> &nbsp;
							발주처 <input type="text" name="companyNm" id="findCompNm" class="inputBox" style="width:80px;ime-Mode:active">
	<!--						<input type="text" name="companyNm" id="findCompNm" class="inputBox" style="width:80px;ime-Mode:active"><input type="text" name="companyNm" id="findCompNm" class="inputBox" style="width:80px;ime-Mode:active"> &nbsp;-->
							제품명 <input type="text" name="prdNm" id="findPrdNm" class="inputBox" style="width:80px" value="<%=paramPrdNm%>"> &nbsp;
							LOT NO <input type="text" name="LotNo" id="findLotNo" class="inputBox" style="width:80px"> &nbsp;
							재고 >= <input type="text" name="findGoods" id="findGoods" class="inputBox" value="0" style="width:60px;"> &nbsp;
							<select name="findType" id="findType">
								<option value="">전체</option>
								<option value="D">개발</option>
								<option value="L">양산</option>
							</select>
							<input type="button" onClick="grid01List()" value="검 색" class="inputBtn">&nbsp;
							<input type="button" onClick="fnSearchReset()" value="Reset" class="inputBtn">
						</td>
					</tr>
				</table>
				<!-- 검색 영역 끝 -->
				<table border="0" cellpadding="0" cellspacing="0" width="1000" style="margin-left:5px"><tr><td style="height:5px"></td></tr></table>
				<table border="0" cellpadding="0" cellspacing="0" width="1090">
					<tr height="24">
						<td style="padding: 0 0 0 0;text-align:left" width="800"><input type="button" class="subTitleBtn" style="width:80px;" value="작업지시" ReadOnly>&nbsp;<a href="javascript:grid01List()">[새로고침]</a> &nbsp; </td>
						<td style="padding: 0 20px 0 0;" align="right" width="290"><input type="button" value="신규" class="inputBtn" onClick="fnReset()"> &nbsp; <B>Total :</B> <span id="grid01Cnt" style="font-weight:bold">0</span></td>
					</tr>
				</table>
				<table border="0" cellpadding="0" cellspacing="0" width="1090"><tr><td style="background-color:#3366CC;height:2px"></td></tr></table>					
				<div id="grid1">
					<div id="gridHeader1">
						<div style="width:60px"><p>LOT No</p></div>
						<div style="width:110px"><p>발주처</p></div>
						<div style="width:276px"><p>제품명</p></div>
						<div style="width:90px"><p>수량／잔량</p></div>
						<div style="width:50px"><p>불량율</p></div>
						<div style="width:90px"><p>공정타입</p></div>
						<div style="width:70px"><p>장비</p></div>
						<div style="width:50px"><p>재고</p></div>
						<div style="width:50px"><p>진행</p></div>
						<div style="width:53px"><p>유무</p></div>
						<div style="width:50px"><p>가공</p></div>
						<div style="width:110px"><p>비고</p></div>
						<div style="width:18px">&nbsp;</div>
					</div>
					<div id="noResult1">
						<div><p>결과가 없습니다.</p></div>
					</div>
					<div id="gridBody1" style="display:none;">								
					</div>
					<div id="gridTail1" style="">
						<div class="term"></div>
						<div id="pager1"></div>
					</div>
				</div>					
			</div>
			<!-- ■■ 첫번째 레이어 끝 ■■ -->
			
			<!-- ■■ 두번째 레이어 시작 ■■ -->
			<div id="layer02" style="display:none">
				<table border="0" cellpadding="0" cellspacing="0" width="1090">
					<form name="frmOrder">
					<input type="hidden" name="procTypes" id="procTypes">
					<input type="hidden" name="processCds" id="processCds">
					<input type="hidden" name="updateDt" id="updateDt">

					<input type="hidden" name="processCds1" id="processCds1">
					<input type="hidden" name="processCds2" id="processCds2">
					<input type="hidden" name="processCds3" id="processCds3">
					<input type="hidden" name="processCds4" id="processCds4">
					<input type="hidden" name="processCds5" id="processCds5">
					<input type="hidden" name="processCds6" id="processCds6">
					<input type="hidden" name="processCds7" id="processCds7">
					<input type="hidden" name="processCds8" id="processCds8">
					<input type="hidden" name="processCds9" id="processCds9">
					<input type="hidden" name="processCds10" id="processCds10">
					<input type="hidden" name="processCds11" id="processCds11">
					<input type="hidden" name="processCds12" id="processCds12">
					<input type="hidden" name="processCds13" id="processCds13">
					<input type="hidden" name="processCds14" id="processCds14">
					<input type="hidden" name="processCds15" id="processCds15">
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 0 0 0 50px; text-align:left; font-weight:bold">
							LOT &nbsp; &nbsp; NO &nbsp; : &nbsp; <input type="text" name="lotNo" id="fullLotNo" size="7" class="inputBox" ReadOnly>-<input type="text" name="lotSubNo" id="lotSubNo" size="1" class="inputBox" ReadOnly> &nbsp; &nbsp; &nbsp;
							발 &nbsp; 주 &nbsp; 처 &nbsp; : &nbsp; <input type="text" name="compNm" id="compNm" size="12" class="specialBox" onblur="fnFindCompany(this.value,'','compCd')">&nbsp;
									<select name="compCd" id="compCd" style="width:150px;" class="specialBox">
										<option value="">-거래처-</option>
									</select>&nbsp; &nbsp; &nbsp;
							제 &nbsp; 품 &nbsp; 명 &nbsp; : &nbsp; 
									<select name="prdCd" id="prdCd" style="width:142px;color:#ff9900" onChange="setPrdInfo(this.value)">
									<option value="">-제품명-</option>
									<%=prdOption%>
									</select>
							&nbsp; &nbsp; &nbsp;
							<a title="잔량=(수량-양품합계)">수량/잔량</a> &nbsp; : &nbsp; <input type="text" name="qty" id="qty" size="5" class="specialBox"> / <input type="text" name="restQty" id="restQty" size="5" class="specialBox">&nbsp; &nbsp; &nbsp;
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 0 0 0 50px; text-align:left; font-weight:bold">
							자재 &nbsp; LOT &nbsp; : &nbsp; <input type="text" name="sourceLotNo" id="sourceLotNo" size="12" class="inputBox"> &nbsp; &nbsp; &nbsp;
							자 재 규 격 &nbsp; : &nbsp; <input type="text" name="sourceSize" id="sourceSize" size="30" class="inputBox">&nbsp; &nbsp; &nbsp;
							납 &nbsp; 기 &nbsp; 일 &nbsp; : &nbsp; <input type="text" name="deliveryDt" id="deliveryDt" size="12" class="specialBox" style="text-align:center">&nbsp; &nbsp; &nbsp;
							&nbsp; &nbsp; &nbsp; 원자재(<span id="orgSrcQty" style="color:#ff0000">0</span>) &nbsp; : &nbsp; <select id="orgSrcCd" style="width:120px"><option value="">--원자재--</option><%=orgSrcOption%></select> &nbsp;<input type="text" id="orgSrcCnt" size="2" class="inputBox"> <img src="/img/icon_select.png" style="cursor:pointer" onClick="fnSaveOutSrc()">
							<!-- 이기능 보류 -->
							<span style="display:none">금 &nbsp; &nbsp; &nbsp; 액 &nbsp; : &nbsp; <input type="hidden" name="amount" id="amount" size="15" class="inputBox" style="text-align:right;padding-right:3px;display:<%=adminShow%>"  onKeyup="commify(this.value,'document.frmOrder.amount')">&nbsp; &nbsp; &nbsp;</span>
							<!-- 이기능 보류 끝 -- 2013-08-23 by Jade --> 
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 0 0 0 0; text-align:center; font-weight:bold">
							<table border="0" cellpadding="0" cellspacing="0" width="1000">
								<tr>
									<td width="333" style="text-align:left;line-height:1.7em;padding:5px 0 8px 0;">
										발주처 특이사항<br>
										<textarea name="compMemo" id="compMemo" style="width:320px;height:120px"></textarea>
									</td>
									<td width="334" style="text-align:left;line-height:1.7em;padding:5px 0 8px 0;">
										작업중 특이사항<br>
										<textarea name="workMemo" id="workMemo" style="width:320px;height:120px"></textarea>
									</td>
									<td width="333" style="text-align:left;line-height:1.7em;padding:5px 0 8px 0;">
										비 고<br>
										<textarea name="remarks" id="remarks" style="width:320px;height:120px"></textarea>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 0 0 0 45px; text-align:left; font-weight:bold">							작업 예정일 &nbsp; : &nbsp; <input type="text" name="planDt" id="planDt" size="12" class="inputBox" style="text-align:center"> &nbsp; &nbsp; 
							 최종 &nbsp; 작업 &nbsp; : &nbsp; <input type="text" name="curProcess" id="curProcess" size="20" class="inputBox">&nbsp; 
							 <select name="type" id="type">
								<option value="D">개발</option>
								<option value="L">양산</option>
							 </select>
							 &nbsp; 
							<select name="flag" id="flag">
								<option value="Y">유효</option>
								<option value="E">완료</option>
								<option value="B">LOT불량</option>
								<option value="N">무효</option>
								<option value="H">보류</option>
							</select> &nbsp; 
							<span id="OrderArticleLayer" style="display:">
							<select name="compOrderArticleSeq" id="compOrderArticleSeq" style="width:120px">
								<option value="0">--오더품목--</option>
							</select> &nbsp;
							</span>

							<input type="text" id="accessInfo" style="font-weight:normal;width:80px; border:0px">
							<input type="button" value="저장" class="inputBtn" onClick="fnSave()"> 
							<input type="button" value="신규" class="inputBtn" onClick="fnReset()">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 0 0 0 45px; text-align:left; font-weight:bold">
							불량율 : <span id="badRate" style="width:60px;color:#cc0099"></span> &nbsp; 
							진행수량 : <span id="ingQty" style="width:40px;color:#cc0099"></span> &nbsp; 
							<input type="button" onclick="fnOpenLot('')" value="[가 공]" class="inputBtn">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 10px 0 5px 45px; text-align:left; font-weight:bold">
							<select name="procTypeCd" id="procTypeCd" style="width:130px;color:#ff9900" onChange="fnShowProcSetDetail(this.value,'')">
								<option value="">-공정 그룹-</option>
								<%=procSet%>
							</select> <span id="showProcSetDetail" style="width:880px;height:20px">&nbsp; &nbsp; &nbsp; Loading....</span>
						</td>
					</tr>
					<tr>
						<td height="20" width="1090" class="lTD_00b0" style="padding: 0 0 0 45px; text-align:left; font-weight:bold"></td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc1">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc1A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc2">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc2A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc3">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc3A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc4">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc4A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc5">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc5A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc6">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc6A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc7">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc7A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc8">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc8A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc9">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc9A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc10">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc10A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc11">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc11A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc12">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc12A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc13">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc13A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc14">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc14A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc15">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 5px 0 5px 45px; text-align:left; font-weight:bold; display:none" id="layerUnitProc15A">
						</td>
					</tr>
					<tr>
						<td height="30" width="1090" class="lTD_00b0" style="padding: 0 0 0 45px; text-align:right; font-weight:bold">						
							<input type="button" value="저장" class="inputBtn" onClick="fnSaveProcess()"> 
							<input type="button" value="출력" class="inputBtn" onClick="fnJobOrderPrint()" style="margin-right:77px">
						</td>
					</tr>
					</form>
				</table>
			</div>
			<!-- ■■ 두번째 레이어 끝 ■■ -->
			<!-- ■■ 세번째 레이어 시작 ■■ -->
			<div id="layer03" style="display:none">
			<!-- 검색 영역 시작 -->
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
					<form name="frmPack">
					<tr height="40">
						<td style="padding: 0px 0 0px 10px;background-image:url(/inc/layout/panel-title-light-bg.gif);font-weight:bold;text-align:left" width="100%" class="lTD_trbl">
							출하일 <input type="text" name="stDate" id="stDate" size="12" class="inputBox" style="text-align:center" value="<%=dateadd("d",-7,Date())%>">
								 ~ <input type="text" name="endDate" id="endDate" size="12" class="inputBox" style="text-align:center" value="<%=Date()%>"> &nbsp;
							발주처 <input type="text" name="companyNm" id="findCompNm2" class="inputBox" style="width:80px;ime-Mode:active"> &nbsp;
							제품명 <input type="text" name="prdNm" id="findPrdNm2" class="inputBox" style="width:80px;"> &nbsp;		
							LOT NO <input type="text" name="LotNo" id="findLotNo2" class="inputBox" style="width:80px;"> &nbsp;		
							<select name="findType3" id="findType3">
								<option value="">전체</option>
								<option value="D">개발</option>
								<option value="L">양산</option>
							</select> &nbsp;
							<select name="findType2" id="findType2"> 
								<option value="10">가공</option>
								<option value="20">검사</option>
								<option value="98" selected>출하</option>
							</select>&nbsp;						
							<select name="findUserId" id="findUserId"> 
								<option value="">-작업자-</option>
								<%=userAll%>
							</select>&nbsp;					
							<input type="button" onClick="grid02List()" value="검 색" class="inputBtn">&nbsp;
							<input type="button" onClick="fnSearch2Reset()" value="Reset" class="inputBtn">
						</td>
					</tr>
					</form>
				</table>
				<!-- 검색 영역 끝 -->
				<br>
				<table border="0" cellpadding="0" cellspacing="0" width="1090">
					<tr height="24">
						<td style="padding: 0 0 0 0;text-align:left" width="800"><input type="text" class="subTitle" style="width:80px;" value="출하정보" ReadOnly>&nbsp;<a href="javascript:grid02List()">[새로고침]</a> &nbsp; <input type="button" onclick="fnOpenBizBillMemo()" value="거래명세서 발행" class="inputBtn"> <input type="text" id="bizBillInfo" style="width:400px;display:none">&nbsp; </td>
						<td style="padding: 0 20px 0 0;" align="right" width="290"><B>Total :</B> <span id="grid02Cnt" style="font-weight:bold">0</span></td>
					</tr>
				</table>
				<table border="0" cellpadding="0" cellspacing="0" width="1090"><tr><td style="background-color:#3366CC;height:2px"></td></tr></table>
							
				<div id="grid2">
					<div id="gridHeader2">
						<div style="width:50px"><p>No.</p></div>
						<div style="width:150px"><p>발주처</p></div>
						<div style="width:100px"><p>작업일자</p></div>
						<div style="width:80px"><p>LOT NO</p></div>
						<div style="width:240px"><p>제품명</p></div>
						<div style="width:123px"><p>수량（양품／불량）</p></div>
						<div style="width:80px"><p>확인자</p></div>
						<div style="width:240px"><p>&nbsp;</p></div>
						<div style="width:18px">&nbsp;</div>
					</div>
					<div id="noResult2">
						<div><p>결과가 없습니다.</p></div>
					</div>
					<div id="gridBody2" style="display:none;">								
					</div>
					<div id="gridTail2" style="">
						<div class="term"></div>
						<div id="pager2"></div>
					</div>
				</div>			
			</div>
			<!-- ■■ 세번째 레이어 끝 ■■ -->
		</td>
		<td width="265">
			<table border="0" cellpadding="0" cellspacing="0" width="147">
				<tr>
					<td>&nbsp;</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>
<div id="jobOrderMemo" style="display:none;position:absolute;width:420px;background-color:#feecd3;border:#ff6600 1px solid;padding:10px 10px 10px 10px; z-index:1">
	<table cellpadding="0" cellspacing="0" border="0" width="400">
		<tr>
			<td style="width:30px;font-weight:bold">메모</td>
			<td style="width:370px;"><input type="hidden" id="processRank"><input type="text" id="orderMemo" style="width:300px"> <input type="button" onClick="fnSaveMemo()" value="저장" class="inputBtn"> </td>
		</tr>
		<tr>
			<td colspan="2" width="100%" style="text-align:right;padding-right:15px"><a href="javascript:fnMemoClose()">[닫기]</a></td>
		</tr>
	</table>
</div>
<div id="noticeContents" style="display:none;position:absolute;width:470px;background-color:#feecd3;border:#ff6600 1px solid;padding:10px 10px 10px 10px; z-index:2">
	<table cellpadding="0" cellspacing="0" border="0" width="450">
		<tr>
			<td style="font-weight:bold;height:40px"> &nbsp; [공지사항] <span id="vTitles"></span></td>
		</tr>
			<td style="text-align:center"><textarea id="contents" class="inputBox" style="width:440px; height:300px" readonly="readonly"></textarea></td>
		</tr>
		<tr>
			<td colspan="2" width="100%" style="text-align:right;height:28px;padding-right:8px;"><input type="button" onClick="fnLayerClose('noticeContents')" value="닫기" class="inputBtn"></td>
		</tr>
	</table>
</div>

<div id="bizBillMemo" style="text-align:left;display:none;position:absolute;width:420px;background-color:#feecd3;border:#ff6600 1px solid;padding:10px 10px 10px 10px; z-index:1">
	<table cellpadding="0" cellspacing="0" border="0" width="400">
		<tr>
			<td style="width:40px;font-weight:bold">내 역</td>
			<td style="width:360px;"><input type="text" id="income" style="width:200px"></td>
		</tr>
		<tr>
			<td style="width:40px;font-weight:bold">메 모</td>
			<td style="width:360px;"><input type="text" id="billMemo" style="width:300px"> <input type="button" onClick="fnMkBizBill()" value="저장" class="inputBtn"> </td>
		</tr>
		<tr>
			<td colspan="2" width="100%" style="text-align:right;padding-right:15px"><a href="javascript:fnLayerClose('bizBillMemo')">[닫기]</a></td>
		</tr>
	</table>
</div>
<script language="javascript">
//	//## 테스트를 위한 기본 값세팅	
//	$("#company").val("아이탱크");
//	$("#owner").val("James");
//	$("#phone").val("02-538-5966");
//	$("#fax").val("02-569-2365");
//	$("#major").val("Jade");
//	$("#cellPhone").val("020-5623-5656");
//	$("#compNo").val("02-232-223369");
//	$("#memo").val("연습입니다. ㅋ");
//	$("#flag").val("Y");
////	$("#compCd").val("4");
</script>
</BODY>
</HTML>